<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/24 0024
 * Time: 10:45
 */

namespace app\admin\controller\mall;


use app\common\controller\AdminController;
use think\facade\View;
class Order extends AdminController
{
    protected function initialize()
    {
        parent::initialize();
        $this->model = app('app\common\model\mall\Order');
    }

    /**
     * 订单列表
     */
    public function get_where($arr = []){
        $array[] = ['status','<>',7];
        if(!empty($arr['order_sn'])){
            $array[] = ['order_sn','like','%'.$arr['order_sn'].'%'];
        }

        return $array;
    }
    /**
     * 详情
     */
    public function get_edit(){
        $id = $this->request->param('id');
        $row = $this->model->with(['Goods','User','OrderUserInfo'])->find($id);

        View::assign('row', $row);
        return View::fetch('edit');
    }
    /**
     * 关联模型
     */
    public function get_with(){
        return ['Goods','User'];
    }
}